package edu.jd.movieplatform.security.register;

import edu.jd.movieplatform.common.Result;
import edu.jd.movieplatform.security.user.UserDto;
import edu.jd.movieplatform.security.user.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.Resources;

@RestController
@RequestMapping("/security/register")
public class RegisterAPI {

    //引入依赖对象
    @Resource //此注解表示从容器中引入依赖对象
    private RegisterService registerService;


    @PostMapping("")
    public Result addUser(@RequestBody RegisterDto dto){
        registerService.addUser(dto);
        return Result.success();
    }
}
